package com.xinghou.platform.dao.main;

import com.xinghou.platform.entity.req.ListReq;
import com.xinghou.platform.model.main.SharedCard;
import org.springframework.dao.DataAccessException;

import java.sql.Timestamp;
import java.util.List;
import java.util.Map;

public interface SharedCardDAO {
	public List<SharedCard> getSharedCard(Long num, int userid)throws DataAccessException;

	public List<SharedCard> getSharedCardByUserid(Map map)throws DataAccessException;
	
	public List<SharedCard> getSharedCardList(Timestamp num, String type,int userid,int ftype) throws DataAccessException;

    public SharedCard getSharedCardBycardId(Integer cardId) throws DataAccessException;
	
	public int updateSharedCard(SharedCard sharedCard) throws DataAccessException;
		
	public int saveSharedCard(SharedCard sharedCard) throws DataAccessException;
	
	public List<SharedCard> getSharedCardlist(byte cardtype,int userid )throws DataAccessException;
	
	public List<SharedCard> getSharedCardbyshoplist(int cardtype,int shopid,int time)throws DataAccessException;
	
	public List<SharedCard> getSharedCardList()throws DataAccessException;
	
	/**
	 * 根据message 得到分享卡信息集合
	 * @return
	 * @throws DataAccessException
	 */
	//public List<SharedCard> sharCardSameShop(Integer userid)throws DataAccessException;
	
	public List<SharedCard> getSharedCardbyshoplist(int cardtype,List<Integer> shopidlist)throws DataAccessException;
	
	public List<SharedCard> getSharedCardbyshoplist(int cardtype, int shopid,int listnum,Long time) throws DataAccessException;

	public List<SharedCard> getSharedCardbyshopid(int shopid,int startno,int pagesize) throws DataAccessException;
	
	public List<Integer> getStoreidListsortbysellcount(List<Integer> storeids,String date)throws DataAccessException;
	
	public List<Integer> getStoreidListsortbysellcount(int skip)throws DataAccessException;
	
	public List<SharedCard> getSharedCardlist(int listnum,int shardcardid,String key) throws DataAccessException;

	public void deleteShare(int shrecardid,String operator);

	/**
	 * 查询商铺最低折扣卡信息
	 * @param shopid
	 * @return
	 * @throws DataAccessException
	 */
	public SharedCard getMinDiscount(int shopid)throws DataAccessException;
	
	/**
	 * 根据折扣查询是否存在晒卡信息(返回一条记录)
	 * @param shopid
	 * @param discount
	 * @return
	 * @throws DataAccessException
	 */
	public SharedCard getSharedCardByDiscount(int shopid,Double discount)throws DataAccessException;
	
	public List<SharedCard> getSharedCardById(int cardid, int pageSize) throws DataAccessException;

	/**
	 * 查询最近3天晒卡信息
	 * @return
	 * @throws DataAccessException
	 */
	public List<SharedCard> getSharedCardThreeDay(Timestamp bt,Timestamp et)throws DataAccessException;

	public int getUserSharedCardCount(Integer uid);
	public List<SharedCard> cardList(ListReq listReq);

	public void cardAudit(ListReq listReq);

	public void addLookStoreList(int userid,int cardid,long createtime);
}
